package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static com.zzyl.common.utils.PageUtils.startPage;


/**
 * @author 14406
 */
@RestController
@RequestMapping("/member/orders/project")
public class appNursingProjectController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;

    //小程序端护理项目分页查询
    @GetMapping("/page")
    public TableDataInfo<NursingProject> pageNursingProject(@ApiParam("护理项目查询条件") Integer pageNum,
                                               Integer pageSize,
                                              @RequestParam(required = false) String name,
                                              @RequestParam(required = false) Integer status)
    {
        return nursingProjectService.pageByNameAndStatus(pageNum,pageSize,name,status);
    }

    @GetMapping("/{id}")
    public R<NursingProject> getInfo(@ApiParam("护理项目ID") @PathVariable("id") Long id)
    {
        return R.ok(nursingProjectService.selectNursingProjectById(id));
    }
}
